/* July 8, 2010 */
package cha.app.simplegraphics;

import android.app.Activity;
import android.content.res.Configuration;
import android.util.Log;
import android.os.Bundle;
import android.util.DisplayMetrics;

//'this' refers to this applications context object

public class SimpleGraphics extends Activity {
  private static final String TAG = "SimpleGraphics";
  private SimpleSquareView block;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    DisplayMetrics screenData = new DisplayMetrics();
    getWindow().getWindowManager().getDefaultDisplay().getMetrics(screenData);
    Log.d(TAG, screenData.heightPixels + " ## " + screenData.widthPixels);
    block = new SimpleSquareView(this, screenData.heightPixels, screenData.widthPixels);
    setContentView(block);
  }
  
  //methods that handle the Activities state changes. must call the
  //corresponding method in the superclass or an exception will be 
  //thrown
//  public void onStart(){  super.onStart(); Log.d(TAG, "Starting");  }
//  public void onPause(){  super.onPause(); Log.d(TAG, "Pausing");  }
//  public void onResume(){  super.onResume(); Log.d(TAG, "Resuming");  }
//  public void onRestart(){  super.onRestart(); Log.d(TAG, "Resuming");  }
//  public void onStop(){ super.onStop(); Log.d(TAG, "Stopping"); }
    public void onDestroy(){
      super.onDestroy();
      block.destroy();
      Log.d(TAG, "Destroying");
   }
}